<template>
	<view>
		<!-- 我的房子 -->
		<view class="heighly">
			<view v-if="dataList.length">
				<view class="m-card u-m-30" v-for="(item, index) in dataList" :key="index">
					<view class="u-m-t-20">
						<view class="u-flex u-flex-items-stretch u-font-24" @click="nextNav('/pages/mine/xiangxi?id=' + item.id+'&type='+type)">
							<view v-for="(items,indexs) in item.imageArr" :key="indexs" v-if="indexs<1">
								<u-image width="100" height="100" :src="items" mode="aspectFit">
								</u-image>
							</view>
							<view class="list-info u-flex-1 u-m-l-15 l-h-g">
								<view class="m-font-b u-font-32">{{item.properties_name}}</view>
								<view class="m-font-b u-font-32">{{item.name}}</view>
								<view class="list-text">
									<text>{{item.bedroom}}室{{item.room}}厅/{{item.area}}㎡</text>
									<text>/{{item.orientation}}</text>
								</view>
								<view class="u-flex u-flex-items-center">
									<view class="u-m-l-10 u-font-24 u-warning-dark-bgs">
										<text>{{item.paytype}}</text>
									</view>
									<view class="u-m-l-20 u-warning-dark-bga">{{item.roomnature}}</view>
								</view>
								<view class="u-flex u-flex-between">
									<view class="u-warning-dark u-font-24">¥{{item.price/1}}元/月</view>
									<!-- <view :class="item.examinedata==='0'?'u-info':item.examinedata==='1'?'u-success-dark':'u-warning-dark'">
										{{item.examinedata==='0'?'审核中':item.examinedata==='1'?'审核通过':'审核不通过'}}
									</view> -->
								</view>
							</view>
						</view>
						<!-- <view class="u-flex u-flex-items-center u-m-t-20">
							<u-icon name="huore" customPrefix="master" size="22" color="#ccc"></u-icon>
							<text class="m-c-h u-m-l-10">房源热度</text>
						</view> -->
						<!-- <view class="u-p-t-25">
							<u-grid :col="4">
								<u-grid-item v-for="(items, ixd) in recom" :key="ixd" @click="nextNav(items.url)">
									<text class="bepad">{{ items.shu }}</text>
									<view class="m-c-b u-m-t-20 u-font-23">{{ items.name }}</view>
								</u-grid-item>
							</u-grid>
						</view> -->
					</view>
				</view>
			</view>
			<list-empty v-else text="暂时没有数据哟!" list="data" :listHighly="highly"></list-empty>
		</view>

		<u-back-top :scrollTop="pagescrollTop" top="200"></u-back-top>
		<u-loading-page loading-text="内当家APP" :loading="pageLoad"></u-loading-page>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [],
				recom: [{
						shu: 0,
						name: '浏览量',
						url: '/pages/mine/liulan'
					},
					{
						shu: 0,
						name: '关注量',
						url: ''
					},
					{
						shu: 0,
						name: '查看量',
						url: ''
					},
					{
						shu: 0,
						name: '咨询量',
						url: ''
					}
				],
				type: 0
			}
		},
		async onLoad() {
			await this.getList();
			if (this.pageLoad) {
				setTimeout(() => {
					this.pageLoad = false;
				}, 1000);
			}
		},
		methods: {
			async getList() { //资讯详情
				this.params = {
					...this.params,
					pnum: this.pnum,
				};
				let res = await this.require('getLeasehouse', this.params);
				if (res) {
					this.dataList = res;
					for (var i = 0; i < this.dataList.length; i++) {
						let looknum = this.dataList[i].looknum
						this.recom[0].shu = looknum
						let follownum = this.dataList[i].follownum
						this.recom[1].shu = follownum
						let seenum = this.dataList[i].seenum
						this.recom[2].shu = seenum
						let consultnum = this.dataList[i].consultnum
						this.recom[3].shu = consultnum
					}
					let that = this
					if (this.dataList.length) {
						that.dataList.forEach(function(item, index, array) {
							let shuzu = item.images.split(',')
							that.dataList[index].imageArr = shuzu
						});
					}
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.bepad {
		font-size: 40rpx;
		font-weight: bold;
		color: #2c2a2b;
	}

	.u-warning-dark-bgs {
		width: 140rpx;
		height: 32rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #cfcfcf;
		color: #daaf7f;
	}

	.u-warning-dark-bga {
		width: 90rpx;
		height: 32rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #cfcfcf;
		color: #daaf7f;
	}

	.l-h-g {
		line-height: 65rpx;
	}
</style>
